<?
$q = $_GET['q'];
if(!$q) return;
function GetConnection()
{
	return new mysqli('wyvern.cs.newpaltz.edu', 'N01727680', 's767467', 'N01727680_db');
}
$conn = GetConnection();
$query = "SELECT name FROM states WHERE name LIKE '%$q%'";
$result = $conn->query($query);
while($out = $result->fetch_assoc()){
	$state = $out['name'];
	echo "$state\n";
}
$conn->close();
?>